

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>ceph-disk – Ceph 的磁盘工具，适用于 OSD &mdash; Ceph Documentation</title>
  

  
  <link rel="stylesheet" href="../../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/graphviz.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />

  
  
    <link rel="shortcut icon" href="../../../_static/favicon.ico"/>
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="../../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
        <script src="../../../_static/jquery.js"></script>
        <script src="../../../_static/underscore.js"></script>
        <script src="../../../_static/doctools.js"></script>
    
    <script type="text/javascript" src="../../../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../../../genindex/" />
    <link rel="search" title="Search" href="../../../search/" /> 
</head>

<body class="wy-body-for-nav">

   
  <header class="top-bar">
    

















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../../../" class="icon icon-home"></a> &raquo;</li>
        
      <li>ceph-disk – Ceph 的磁盘工具，适用于 OSD</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
          
            <a href="../../../_sources/man/8/ceph-disk.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
  </header>
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: #eee" >
          

          
            <a href="../../../">
          

          
            
            <img src="../../../_static/logo.png" class="logo" alt="Logo"/>
          
          </a>

          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../../search/" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul>
<li class="toctree-l1"><a class="reference internal" href="../../../start/intro/">Ceph 简介</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../install/">安装 Ceph</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../cephadm/">Cephadm</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../rados/">Ceph 存储集群</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../cephfs/">Ceph 文件系统</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../rbd/">Ceph 块设备</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../radosgw/">Ceph 对象网关</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../mgr/">Ceph 管理器守护进程</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../mgr/dashboard/">Ceph 仪表盘</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../api/">API 文档</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../architecture/">体系结构</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../dev/developer_guide/">开发者指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../dev/internals/">Ceph 内幕</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../governance/">项目管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../foundation/">Ceph 基金会</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../ceph-volume/">ceph-volume</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../releases/general/">Ceph 版本（总目录）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../releases/">Ceph 版本（索引）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../security/">Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../glossary/">Ceph 术语</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../jaegertracing/">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../translation_cn/">中文版翻译资源</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../../">Ceph</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
<div id="dev-warning" class="admonition note">
  <p class="first admonition-title">Notice</p>
  <p class="last">This document is for a development version of Ceph.</p>
</div>
  <div id="docubetter" align="right" style="padding: 5px; font-weight: bold;">
    <a href="https://pad.ceph.com/p/Report_Documentation_Bugs">Report a Documentation Bug</a>
  </div>

  
  <div class="section" id="ceph-disk-ceph-osd">
<h1>ceph-disk – Ceph 的磁盘工具，适用于 OSD<a class="headerlink" href="#ceph-disk-ceph-osd" title="Permalink to this headline">¶</a></h1>
<div class="section" id="id1">
<h2>提纲<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h2>
<div class="line-block">
<div class="line"><strong>ceph-disk</strong> [-h] [-v] [–log-stdout] [–prepend-to-path PATH]</div>
<div class="line-block">
<div class="line">[–statedir PATH] [–sysconfdir PATH]</div>
<div class="line">[–setuser USER] [–setgroup GROUP]</div>
<div class="line">…</div>
</div>
</div>
<div class="section" id="id2">
<h3>可选参数<a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h3>
<dl class="option-list">
<dt><kbd><span class="option">-h</span>, <span class="option">--help</span></kbd></dt>
<dd><p>显示本帮助消息后退出</p>
</dd>
<dt><kbd><span class="option">-v</span>, <span class="option">--verbose</span></kbd></dt>
<dd><p>输出得更详细些</p>
</dd>
<dt><kbd><span class="option">--log-stdout</span></kbd></dt>
<dd><p>日志输出到 stdout</p>
</dd>
<dt><kbd><span class="option">--prepend-to-path <var>PATH</var></span></kbd></dt>
<dd><p>把 PATH 安插到 $PATH 前面，为保持向后兼容性（默认为 /usr/bin ）</p>
</dd>
<dt><kbd><span class="option">--statedir <var>PATH</var></span></kbd></dt>
<dd><p>用于存放 Ceph 状态的目录（默认为 /var/lib/ceph ）</p>
</dd>
<dt><kbd><span class="option">--sysconfdir <var>PATH</var></span></kbd></dt>
<dd><p>用于存放 Ceph 配置文件的目录（默认为 /etc/ceph ）</p>
</dd>
<dt><kbd><span class="option">--setuser <var>USER</var></span></kbd></dt>
<dd><p>指定子进程的所属用户，取代默认的 ceph 或 root</p>
</dd>
<dt><kbd><span class="option">--setgroup <var>GROUP</var></span></kbd></dt>
<dd><p>指定子进程的所属用户组，取代默认的 ceph 或 root</p>
</dd>
</dl>
</div>
<div class="section" id="id3">
<h3>子命令<a class="headerlink" href="#id3" title="Permalink to this headline">¶</a></h3>
<dl class="simple">
<dt>prepare</dt><dd><p>为 Ceph OSD 准备一个目录或磁盘</p>
</dd>
<dt>activate</dt><dd><p>激活一个 Ceph OSD</p>
</dd>
<dt>activate-lockbox</dt><dd><p>激活一个 Ceph lockbox</p>
</dd>
<dt>activate-block</dt><dd><p>通过其块设备激活一个 OSD</p>
</dd>
<dt>activate-journal</dt><dd><p>通过其日志设备激活一个 OSD</p>
</dd>
<dt>activate-all</dt><dd><p>激活所有标记过的 OSD 分区</p>
</dd>
<dt>list</dt><dd><p>罗列磁盘、分区、和 Ceph OSD</p>
</dd>
<dt>suppress-activate</dt><dd><p>抑制设备，防止被激活（前缀）</p>
</dd>
<dt>unsuppress-activate</dt><dd><p>取消对设备的抑制（前缀）</p>
</dd>
<dt>deactivate</dt><dd><p>弄死一个 Ceph OSD</p>
</dd>
<dt>destroy</dt><dd><p>拆除一个 Ceph OSD</p>
</dd>
<dt>zap</dt><dd><p>干掉、擦除、破坏某一设备的分区表（及其内容）</p>
</dd>
<dt>trigger</dt><dd><p>触发一个事件（底层为 udev ）</p>
</dd>
<dt>fix</dt><dd><p>修正 SELinux 标签和、或文件权限位。</p>
</dd>
</dl>
</div>
</div>
<div class="section" id="id4">
<h2>描述<a class="headerlink" href="#id4" title="Permalink to this headline">¶</a></h2>
<p><strong class="program">ceph-disk</strong> 工具可把硬盘、分区或目录预处理并激活为
Ceph OSD 。可单独使用，也可由 <strong class="program">ceph-deploy</strong> 或
<code class="docutils literal notranslate"><span class="pre">udev</span></code> 调用，还可由其他部署工具，如 <code class="docutils literal notranslate"><span class="pre">Chef</span></code> 、 <code class="docutils literal notranslate"><span class="pre">Juju</span></code> 、
<code class="docutils literal notranslate"><span class="pre">Puppet</span></code> 等调用。</p>
<p>其实它是把手动创建并启动 OSD 的很多步骤自动化成了两步：预处理和激活，分别对应两个子命令 <code class="docutils literal notranslate"><span class="pre">prepare</span></code> 和 <code class="docutils literal notranslate"><span class="pre">activate</span></code> 。</p>
<p><strong class="program">ceph-disk</strong> 也把手动停止和销毁某一 OSD 的多个步骤自动化成了两步：停用和销毁，分别对应 <code class="docutils literal notranslate"><span class="pre">deactivate</span></code> 和
<code class="docutils literal notranslate"><span class="pre">destroy</span></code> 子命令。</p>
<p>各个子命令的文档（ prepare 、 activate 等等）可用它的
<code class="docutils literal notranslate"><span class="pre">--help</span></code> 选项显示，例如 <code class="docutils literal notranslate"><span class="pre">ceph-disk</span> <span class="pre">prepare</span> <span class="pre">--help</span></code> 。</p>
</div>
<div class="section" id="id5">
<h2>已知缺陷<a class="headerlink" href="#id5" title="Permalink to this headline">¶</a></h2>
<p>请参考 <a class="reference internal" href="../ceph-detect-init/"><span class="doc">ceph-detect-init</span></a>(8) 里的<code class="docutils literal notranslate"><span class="pre">已知缺陷</span></code>一节。</p>
</div>
<div class="section" id="id6">
<h2>使用范围<a class="headerlink" href="#id6" title="Permalink to this headline">¶</a></h2>
<p><strong class="program">ceph-disk</strong> 是 Ceph 的一部分，这是个伸缩力强、开源、分布式的存储系统，更多信息参见 <a class="reference external" href="http://ceph.com/docs">http://ceph.com/docs</a> 。</p>
</div>
<div class="section" id="id7">
<h2>参考<a class="headerlink" href="#id7" title="Permalink to this headline">¶</a></h2>
<p><a class="reference internal" href="../ceph-osd/"><span class="doc">ceph-osd</span></a>(8),
<a class="reference internal" href="../ceph-deploy/"><span class="doc">ceph-deploy</span></a>(8)</p>
</div>
</div>



           </div>
           
          </div>
          <footer>

  <hr/>

  <div role="contentinfo">
    <p>
        &#169; Copyright 2016, Ceph authors and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0).

    </p>
  </div> 

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>